package com.codehub.service;

import com.codehub.entity.po.SysAccount;
import com.codehub.entity.query.AccountQuery;
import com.codehub.entity.dto.SessionAdminUserDto;
import com.codehub.entity.vo.PaginationResultVO;
import com.codehub.exception.BusinessException;

import java.util.List;

/**
 * 账号信息Service
 */
public interface SysAccountService {

/**
 * 根据条件查询列表
 */
List<SysAccount> findListByParam(AccountQuery query);

/**
 * 根据条件查询数量
 */
Integer findCountByParam(AccountQuery query);

/**
 * 分页查询
 */
PaginationResultVO<SysAccount> findListByPage(AccountQuery query);

/**
 * 新增
 */
Integer add(SysAccount bean);

/**
 * 批量新增
 */
Integer addBatch(List<SysAccount> ListBean);

/**
 * 批量新增或修改
 */
Integer addOrUpdateBatch(List<SysAccount> ListBean);

/**
 * 根据UserId查询
 */
SysAccount getAccountByUserId(Integer userId);

/**
 * 根据UserId更新
 */
Integer updateAccountByUserId(SysAccount bean, Integer userId);

/**
 * 根据UserId删除
 */
Integer deleteAccountByUserId(Integer userId);

/**
 * 根据Phone查询
 */
SysAccount getAccountByPhone(String phone);

/**
 * 根据Phone更新
 */
Integer updateAccountByPhone(SysAccount bean, String phone);

/**
 * 根据Phone删除
 */
Integer deleteAccountByPhone(String phone);

SessionAdminUserDto login(String phone, String password) throws BusinessException;

void saveSysAccount(SysAccount sysAccount) throws BusinessException;

}